package interfaces.model;


/***
 *  * CellAI is used by Cell to act. It contains all the Rules that the cells should follow and 
 * decides what their next state should be based on the rules. The CellAI is a singleton and 
 * is the only brain of the cells that subscribe to the specific AI.
 * Rules should be mutually exclusive or there will be problems with conflicting next states. 
 * 
 * @author thwhyte
 *
 */
public interface CellAI {
	/**
	 * Adds a rule to the CellAI. This rule will be considered for every cell after it is added.
	 * @param rule : The desired rule to add
	 */
	public boolean addRule(Rule rule);
	/**
	 * Removes a specific rule from the list of rules to consider for each cell.
	 * Returns true if succeeded.
	 * @param rule : the rule to be removed
	 */
	public boolean removeRule(Rule rule);
	/**
	 * Determines the next state of the cell. This is called by the Act() method in each cell.
	 * Returns true if succeeded.
	 * @param cell : This should be the cell that is acting.
	 * @return String nextState : the state the cell should be in after considering all the rules.
	 */
	public String nextState(Cell cell);
}

